﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using DTOAuction;
using System.Configuration;


namespace DAOAuction
{
    public class DAOGiaoVien
    {
        public List<GIAOVIEN_getallwithMaKhoaResult> layDanhSachGiaoVienTheoMaKhoa(int maKhoa)
        {
            List<GIAOVIEN_getallwithMaKhoaResult> listLop = new List<GIAOVIEN_getallwithMaKhoaResult>();
            try
            {
                LinqDataContext db = new LinqDataContext(global::DAOAuction.Properties.Settings.Default.QUANLYGIAODUCConnectionString);
                ISingleResult<GIAOVIEN_getallwithMaKhoaResult> lop = db.GIAOVIEN_getallwithMaKhoa(maKhoa);

                foreach (GIAOVIEN_getallwithMaKhoaResult l in lop)
                {
                    GIAOVIEN_getallwithMaKhoaResult var1 = new GIAOVIEN_getallwithMaKhoaResult();
                    var1.TENGIAOVIEN = l.TENGIAOVIEN;
                    var1.MAGIAOVIEN = l.MAGIAOVIEN;

                    listLop.Add(var1);
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return listLop;
        }
    }
}
